package site.marqstree.latte.core.wechat;

import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;

/*
 * 项目名: EleCommerce
 * 包名: site.marqstree.latte.core.wechat
 * 文件名: BaseWXActivity
 * 创建者: marqstree
 * 创建时间: 2020/1/20 16:34
 * 描述: TODO
 */
public abstract class BaseWXActivity extends AppCompatActivity implements IWXAPIEventHandler {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //这个必须写在onCreate中
        LatteWeChat.getInstance().getWXAPI().handleIntent(getIntent(), this);
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        setIntent(intent);
        LatteWeChat.getInstance().getWXAPI().handleIntent(getIntent(), this);
    }
}
